- Writer <W, A> (Func<W, (A Value, W Output)> runWriter)
- Pure (A value)
- Write ((A Value, W Output) result)
- Write (A value, W output)
- Listen ()
- Listens <B> (Func<W, B> f)
- Censor (Func<W, W> f)
- Lift (Pure<A> monad)
- Lift (Func<A> f)
- Map <B> (Func<A, B> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<Writer<W>, B>> f)
- Bind <B> (Func<A, Writer<W, B>> f)
- Bind <B> (Func<A, Tell<W>> f)
- SelectMany <B, C> (Func<A, K<Writer<W>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Writer<W, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <C> (Func<A, Tell<W>> bind, Func<A, Unit, C> project)
- Run ()
- WriterExtensions
- Writer <W>
- Writer
- Pure <W, A> (A value)
- bind <W, A, B> (Writer<W, A> ma, Func<A, Writer<W, B>> f)
- map <W, A, B> (Func<A, B> f, Writer<W, A> ma)
- apply <W, A, B> (Writer<W, Func<A, B>> mf, Writer<W, A> ma)
- action <W, A, B> (Writer<W, A> ma, Writer<W, B> mb)
- tell <W> (W item)
- write <W, A> ((A, W) item)
- write <W, A> (A value, W item)
- pass <W, A> (Writer<W, (A Value, Func<W, W> Function)> action)
- listen <W, A> (Writer<W, A> ma)
- listens <W, A, B> (Func<W, B> f, Writer<W, A> ma)
- censor <W, A> (Func<W, W> f, Writer<W, A> ma)
- Writer <W>
- Prelude
record Writer <W, A> (Func<W, (A Value, W Output)> runWriter) Source #
Writer
monad transformer, which adds a modifiable state to a given monad.
type | S | State type |
type | M | Given monad trait |
type | A | Bound value type |
param | runState | Transducer that represents the transformer operation |
method Writer<W, A> Pure (A value) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method Writer<W, A> Write ((A Value, W Output) result) Source #
Construct a writer computation from a (result, output) pair.
The inverse of Run()
param | result | Result / Output pair |
method Writer<W, A> Write (A value, W output) Source #
Construct a writer computation from a (result, output) pair.
The inverse of Run()
param | result | Result / Output pair |
method Writer<W, (A Value, W Output)> Listen () Source #
Writes an item and returns a value at the same time
method Writer<W, (A Value, B Output)> Listens <B> (Func<W, B> f) Source #
Listens
executes the action and adds the result of applying f
to the
output to the value of the computation.
method Writer<W, A> Censor (Func<W, W> f) Source #
Censor
executes the action and applies the function f
to its output,
leaving the return value unchanged.
method Writer<W, A> Lift (Pure<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method Writer<W, A> Lift (Func<A> f) Source #
Lifts a function into the transformer
param | f | Function to lift |
returns |
|
method Writer<W, B> Map <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Writer<W, B> Select <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping transducer |
returns |
|
method Writer<W, B> Bind <B> (Func<A, K<Writer<W>, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Writer<W, B> Bind <B> (Func<A, Writer<W, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Writer<W, Unit> Bind <B> (Func<A, Tell<W>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method Writer<W, C> SelectMany <B, C> (Func<A, K<Writer<W>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Writer<W, C> SelectMany <B, C> (Func<A, Writer<W, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Writer<W, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method Writer<W, C> SelectMany <C> (Func<A, Tell<W>> bind, Func<A, Unit, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
class WriterExtensions Source #
method Writer<W, B> bind <W, A, B> (Writer<W, A> ma, Func<A, Writer<W, B>> f) Source #
method Writer<W, B> apply <W, A, B> (Writer<W, Func<A, B>> mf, Writer<W, A> ma) Source #
method Writer<W, B> action <W, A, B> (Writer<W, A> ma, Writer<W, B> mb) Source #
method Writer<W, Unit> tell <W> (W item) Source #
Tell is an action that produces the writer output
type | W | Writer type |
param | item | Item to tell |
returns | Structure with the told item |
method Writer<W, A> write <W, A> ((A, W) item) Source #
Writes an item and returns a value at the same time
method Writer<W, A> write <W, A> (A value, W item) Source #
Writes an item and returns a value at the same time
method Writer<W, A> pass <W, A> (Writer<W, (A Value, Func<W, W> Function)> action) Source #
pass
is an action that executes the action
, which returns a value and a
function; it then returns a the value with the output having been applied to
the function.
method Writer<W, (A Value, W Output)> listen <W, A> (Writer<W, A> ma) Source #
listen
is executes the action ma
and adds the result of applying f
to the
output to the value of the computation.
MonadStateT
trait implementation for StateT
type | S | State environment type |
type | M | Given monad trait |
method Writer<W, Unit> tell <W> (W item) Source #
Tell is an action that produces the writer output
type | W | Writer type |
param | item | Item to tell |
returns | Structure with the told item |
method Writer<W, A> write <W, A> ((A, W) item) Source #
Writes an item and returns a value at the same time
method Writer<W, A> write <W, A> (A value, W item) Source #
Writes an item and returns a value at the same time
method Writer<W, A> pass <W, A> (Writer<W, (A Value, Func<W, W> Function)> action) Source #
pass
is an action that executes the action
, which returns a value and a
function; it then returns a the value with the output having been applied to
the function.
method Writer<W, (A Value, W Output)> listen <W, A> (Writer<W, A> ma) Source #
listen
is executes the action ma
and adds the result of applying f
to the
output to the value of the computation.